public class Vector2D
{
	public double x;
	public double y;

	public Vector2D(double x, double y)
	{
		this.x=x;
		this.y=y;
	}

	public Vector2D(Vector2D vector2D)
	{
		this.x = vector2D.x;
		this.y = vector2D.y;
	}

	public Vector2D add(Vector2D vector2)
	{
		return new Vector2D(this.x + vector2.x, this.y + vector2.y);
	}

	public Vector2D substract(Vector2D vector2)
	{
		return new Vector2D(this.x - vector2.x, this.y - vector2.y);
	}

	public Vector2D multiply(double scalar)
	{
		return new Vector2D(this.x * scalar, this.y * scalar);
	}

	public double getLength()
	{
		return Math.sqrt(x * x + y * y);
	}
	
	public double dotProduct(Vector2D vector2)
	{
		return this.x*vector2.x + this.y*vector2.y;
	}

	public boolean isZero()
	{
		return (x==0&&y==0);
	}
}
